<?php
/**
*Copyright:D5game.com.cn
*Date:2011-6-17
*Author:Yuanqi
*/

include('../common.php');

require_once (S_ROOT.'./source/action/act_yeepay_payment.php');
$showmsg = '交易信息异常，请与网站管理员联系！';
$pay = new act_yeepay_payment("1");
$pay->set_params($_REQUEST,'resp');

if($pay->verify_callbackhmac())
{
	if($_REQUEST['r9_BType']=="1"){
		$showmsg = '订单号：'.$_REQUEST['r6_Order'].'<br/>';
		$showmsg .= '商品名称：'.urldecode($_REQUEST['r5_Pid']).'<br/>';
		$showmsg .= '支付金额：'.$_REQUEST['r3_Amt'].'<br/>';
		$showmsg .= "交易成功!";
	}elseif($_REQUEST['r9_BType']=="2"){
		#如果需要应答机制则必须回写流,以success开头,大小写不敏感.
		echo "success";
		echo "<br />交易成功";
		echo  "<br />在线支付服务器返回"; 
		exit;     			 
	}

	$pay->parse_payresult();
}
else {
	$showmsg = '非法交易信息！';
}
?>
<?php header("Content-type: text/vnd.wap.wml"); ?>
<?php echo"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
    <head>
        <meta http-equiv="Cache-control" content="no-cache"/>
    </head>
        <card id="yeepay" title="易宝支付" >
        <p align="left"><?=$showmsg?><br/><a href="/index.php">返回拍客宝</a>
    </p>
    </card>
</wml>